package com.atguigu.spzx.feign.product;

import com.atguigu.spzx.feign.product.fallback.ProductFeignClientFallback;
import com.atguigu.spzx.model.entity.product.ProductSku;
import com.atguigu.spzx.model.vo.common.Result;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Map;

/**
 * @author LT
 * @create 2024-03-28-15:49
 */
@FeignClient(value = "service-product",fallback = ProductFeignClientFallback.class)
public interface ProductFeignClient {

    @GetMapping("/api/product/getBySkuId/{skuId}")
    public abstract Result<ProductSku> getBySkuId(@PathVariable("skuId")Long skuId);

    @PutMapping("/api/product/sku/batchUpdateSkuStockAndSale")
    public Result batchUpdateSkuStockAndSale(@RequestBody Map<Long, Integer>  map);

}
